home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 240 (DVD) / Issue 240 - February 2008 - DPCS0208DVD.ISO / BO Expert tools / AutoHotKey / Source / AutoHotkey104702_source.exe / source / lib_pcre / pcre / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-11-03  |  6.9 KB  |  157 lines

  1.  
  2. /* On Unix-like systems config.in is converted by "configure" into config.h.
  3. Some other environments also support the use of "configure". PCRE is written in
  4. Standard C, but there are a few non-standard things it can cope with, allowing
  5. it to run on SunOS4 and other "close to standard" systems.
  6.  
  7. On a non-Unix-like system you should just copy this file into config.h, and set
  8. up the macros the way you need them. You should normally change the definitions
  9. of HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way
  10. autoconf works, these cannot be made the defaults. If your system has bcopy()
  11. and not memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE.
  12. If your system has neither bcopy() nor memmove(), leave them both as 0; an
  13. emulation function will be used. */
  14.  
  15. /* If you are compiling for a system that uses EBCDIC instead of ASCII
  16. character codes, define this macro as 1. On systems that can use "configure",
  17. this can be done via --enable-ebcdic. */
  18.  
  19. #ifndef EBCDIC
  20. #define EBCDIC 0
  21. #endif
  22.  
  23. /* If you are compiling for a system other than a Unix-like system or Win32,
  24. and it needs some magic to be inserted before the definition of a function that
  25. is exported by the library, define this macro to contain the relevant magic. If
  26. you do not define this macro, it defaults to "extern" for a C compiler and
  27. "extern C" for a C++ compiler on non-Win32 systems. This macro apears at the
  28. start of every exported function that is part of the external API. It does not
  29. appear on functions that are "external" in the C sense, but which are internal
  30. to the library. */
  31.  
  32. /* #define PCRE_DATA_SCOPE */
  33.  
  34. /* Define the following macro to empty if the "const" keyword does not work. */
  35.  
  36. #undef const
  37.  
  38. /* Define the following macro to "unsigned" if <stddef.h> does not define
  39. size_t. */
  40.  
  41. #undef size_t
  42.  
  43. /* The following two definitions are mainly for the benefit of SunOS4, which
  44. does not have the strerror() or memmove() functions that should be present in
  45. all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should
  46. normally be defined with the value 1 for other systems, but unfortunately we
  47. cannot make this the default because "configure" files generated by autoconf
  48. will only change 0 to 1; they won't change 1 to 0 if the functions are not
  49. found. */
  50.  
  51. #define HAVE_STRERROR 1
  52. #define HAVE_MEMMOVE  1
  53.  
  54. /* There are some non-Unix-like systems that don't even have bcopy(). If this
  55. macro is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of
  56. HAVE_BCOPY is not relevant. */
  57.  
  58. #define HAVE_BCOPY    0
  59.  
  60. /* The value of NEWLINE determines the newline character. The default is to
  61. leave it up to the compiler, but some sites want to force a particular value.
  62. On Unix-like systems, "configure" can be used to override this default. */
  63.  
  64. #ifndef NEWLINE
  65. /* AutoHotkey: Neither 1338 nor (('\r' << 8) | '\n') worked properly in the line below,
  66. and I couldn't find out the proper value after a reasonable amount of research (I even
  67. tried ./configure --enable-newline-is-crlf on Unix, but it too produced '\n' in its
  68. config.h file). Therefore, I'm taking the approach of compiling each pattern with
  69. a default option of PCRE_NEWLINE_CRLF, which from looking at the PCRE source is
  70. unlikely to impact perfromance. */
  71. #define NEWLINE '\n'
  72. #endif
  73.  
  74. /* The value of LINK_SIZE determines the number of bytes used to store links as
  75. offsets within the compiled regex. The default is 2, which allows for compiled
  76. patterns up to 64K long. This covers the vast majority of cases. However, PCRE
  77. can also be compiled to use 3 or 4 bytes instead. This allows for longer
  78. patterns in extreme cases. On systems that support it, "configure" can be used
  79. to override this default. */
  80.  
  81. #ifndef LINK_SIZE
  82. #define LINK_SIZE   2
  83. #endif
  84.  
  85. /* When calling PCRE via the POSIX interface, additional working storage is
  86. required for holding the pointers to capturing substrings because PCRE requires
  87. three integers per substring, whereas the POSIX interface provides only two. If
  88. the number of expected substrings is small, the wrapper function uses space on
  89. the stack, because this is faster than using malloc() for each call. The
  90. threshold above which the stack is no longer used is defined by POSIX_MALLOC_
  91. THRESHOLD. On systems that support it, "configure" can be used to override this
  92. default. */
  93.  
  94. #ifndef POSIX_MALLOC_THRESHOLD
  95. #define POSIX_MALLOC_THRESHOLD 10
  96. #endif
  97.  
  98. /* PCRE uses recursive function calls to handle backtracking while matching.
  99. This can sometimes be a problem on systems that have stacks of limited size.
  100. Define NO_RECURSE to get a version that doesn't use recursion in the match()
  101. function; instead it creates its own stack by steam using pcre_recurse_malloc()
  102. to obtain memory from the heap. For more detail, see the comments and other
  103. stuff just above the match() function. On systems that support it, "configure"
  104. can be used to set this in the Makefile (use --disable-stack-for-recursion). */
  105.  
  106. /* #define NO_RECURSE */
  107.  
  108. /* The value of MATCH_LIMIT determines the default number of times the internal
  109. match() function can be called during a single execution of pcre_exec(). There
  110. is a runtime interface for setting a different limit. The limit exists in order
  111. to catch runaway regular expressions that take for ever to determine that they
  112. do not match. The default is set very large so that it does not accidentally
  113. catch legitimate cases. On systems that support it, "configure" can be used to
  114. override this default default. */
  115.  
  116. #ifndef MATCH_LIMIT
  117. #define MATCH_LIMIT 10000000
  118. #endif
  119.  
  120. /* The above limit applies to all calls of match(), whether or not they
  121. increase the recursion depth. In some environments it is desirable to limit the
  122. depth of recursive calls of match() more strictly, in order to restrict the
  123. maximum amount of stack (or heap, if NO_RECURSE is defined) that is used. The
  124. value of MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
  125. have any useful effect, it must be less than the value of MATCH_LIMIT. There is
  126. a runtime method for setting a different limit. On systems that support it,
  127. "configure" can be used to override this default default. */
  128.  
  129. /* AutoHotkey: Original value was MATCH_LIMIT (i.e. 10000000).  It was lowered to 6000 so that
  130. the program's current stack limit of 4 MB won't be exceeded. The limit was computed from the
  131. following info in PCRE docs somewhere: "As a very rough rule of thumb, you should reckon on
  132. about 500 bytes per recursion. Thus, if you want to limit your stack usage to 8Mb, you should
  133. set the limit at 16000 recursions. A 64Mb stack, on the other hand, can support around
  134. 128000 recursions."
  135. */
  136. #ifndef MATCH_LIMIT_RECURSION
  137. #define MATCH_LIMIT_RECURSION 6000
  138. #endif
  139.  
  140. /* These three limits are parameterized just in case anybody ever wants to
  141. change them. Care must be taken if they are increased, because they guard
  142. against integer overflow caused by enormously large patterns. */
  143.  
  144. #ifndef MAX_NAME_SIZE
  145. #define MAX_NAME_SIZE 32
  146. #endif
  147.  
  148. #ifndef MAX_NAME_COUNT
  149. #define MAX_NAME_COUNT 10000
  150. #endif
  151.  
  152. #ifndef MAX_DUPLENGTH
  153. #define MAX_DUPLENGTH 30000
  154. #endif
  155.  
  156. /* End */
  157.